Skip to content

Conversation

@itashia
Copy link

@itashia itashia commented May 26, 2025

Summary of Improvements

  • Stronger type hints for properties and methods
  • Separated logic into normalizeRoles() and unauthorized() helpers
  • Used (string) cast for safer role handling
  • Switched to $this->auth->user() for better consistency
  • Improved code readability and PSR-12 compliance

No changes in behavior — fully backward-compatible.

Refactor with stricter type hints and cleaner structure:

- Added type hint for $auth and handle() return type
- Extracted normalizeRoles() and unauthorized() methods
- Used (string) casting for role values
- Replaced $request->user() with $this->auth->user()
- Improved naming and PSR-12 formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant